package org.NooLab.nlp.structures;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Vector;


import org.NooLab.structures.nlp.NLPresultSetIntf;
import org.NooLab.structures.nlp.PoStagged;
import org.NooLab.structures.nlp.WordSets;



public class NLPresultSet implements NLPresultSetIntf, Serializable{

	private static final long serialVersionUID = -8661154844605898924L;

	// move it to the structures package
	// the result set should know whether it is the last of a series, else it needs the gui
	
	String guid = "" ; // uses the guid of the incoming task
	
	/** with regard to the current guid
	 *  a text could contain many sentences, each of the sentences produces
	 *  intermediate results, which could be delivered "in-process", such
	 *  the host process needs to know whether a particular package is the last one.
	 */
	boolean isLastResultSet = true; 
	
	boolean mergedResults = false ;
	ArrayList<Integer> mergedDimension = new ArrayList<Integer>(); 
	
	int positionInText = -1;
	
	/**  */
	String mainPhrase = "" ;
	String coreSentence = "" ;
	String nounPhrase = "" ;
	String verbPhrase = "" ;
	
	ArrayList<PoStagged> nouns = new ArrayList<PoStagged>();
	ArrayList<PoStagged> verbs = new ArrayList<PoStagged>();

	ArrayList<PoStagged> taggedSentence = new ArrayList<PoStagged>();
	
	ArrayList<PoStagged> taggedPoS = new ArrayList<PoStagged>(); 
	// the same as previous , just as a prepared human-readable string
	String allPoSasStr=""; 
	String allSemCodesAsStr = "" ;
	
	ArrayList<String> collectedVerbPhrases = new ArrayList<String>() ;
	ArrayList<String> collectedNouns = new ArrayList<String>() ;
	
	String prepositionalPhrase = "" ;
	ArrayList<PoStagged> prepsPhrasePoS = new ArrayList<PoStagged>();


	// simply the rest of the stuff in a sentence
	// which provide specifying/differentiating info abut the msg in the core sentence 
	ArrayList<String> objectedDescriptors = new ArrayList<String> ();	
	
	/**                          
	 * <p>
	 * coherent snippets taken from the sentence, which reflect different syntactical 
	 *    (and LATER ALSO semantical bindings</p>
	 * they depend on the parse tree and/or the BST weights table,
	 *    or the parse tree AS derived from BST weight table;<br/>
	 *  
	 *  the BST weights a handled probabilistically, hence different chunks are created
	 *  
	 */
	ArrayList<String> chunks = new ArrayList<String>() ;
	String originalText;
	
	WordSets wordSets = new WordSets();
	boolean isSimple = false;
	

	private ArrayList<String> wordsetLabels; 
	
	// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	public NLPresultSet(){
	
		mergedDimension.add( NLPresultSetIntf._RESULTS_MERGED_WORDSETS ) ;
	}
	// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	

	public void setWordsetLabels(ArrayList<String> wsLabels) {
		// 
		if ((wsLabels!=null) & (wsLabels.size()>0)){
			wordsetLabels = new ArrayList<String>(wsLabels);
		}
	}



	public ArrayList<String> getWordsetLabels() {
		return wordsetLabels;
	}


	public int getPositionInText() {
		return positionInText;
	}

	
	public void setPositionInText(int positionInText) {
		this.positionInText = positionInText;
	}

	@Override
	public String getMainPhrase() {
		return mainPhrase;
	}


	public void setMainPhrase(String mainPhrase) {
		this.mainPhrase = mainPhrase;
	}

	@Override
	public String getCoreSentence() {
		return coreSentence;
	}



	public void setCoreSentence(String coreSentence) {
		this.coreSentence = coreSentence;
	}


	@Override
	public String getOriginalText() {
		return originalText;
	}


	@Override
	public void setOriginalText(String originalText) {
		this.originalText = originalText;
	}



	public String getNounPhrase() {
		return nounPhrase;
	}


	public void setNounPhrase(String nounPhrase) {
		this.nounPhrase = nounPhrase;
	}


	public String getVerbPhrase() {
		return verbPhrase;
	}


	public void setVerbPhrase(String verbPhrase) {
		this.verbPhrase = verbPhrase;
	}

	@Override
	public ArrayList<PoStagged> getNouns() {
		return nouns;
	}


	public void setNouns(ArrayList<PoStagged> nouns) {
		this.nouns = nouns;
	}


	public ArrayList<PoStagged> getVerbs() {
		return verbs;
	}


	public void setVerbs(ArrayList<PoStagged> verbs) {
		this.verbs = verbs;
	}



	public ArrayList<String> getChunks() {
		return chunks;
	}



	public void setChunks(ArrayList<String> chunks) {
		this.chunks.addAll( chunks );
	}


	@Override
	public ArrayList<PoStagged> getTaggedPoS() {
		return taggedPoS;
	}

	@Override
	public ArrayList<String> getCollectedVerbPhrases() {
		return  collectedVerbPhrases ;
	}
	
	public void setCollectedVerbPhrases(ArrayList<String> collectedVerbPhrases) {
		this.collectedVerbPhrases = collectedVerbPhrases;
	}

	
	

	public ArrayList<String> getCollectedNouns() {
		return collectedNouns;
	}



	public void setCollectedNouns(ArrayList<String> collectedNouns) {
		this.collectedNouns = collectedNouns;
	}



	public String getPrepositionalPhrase() {
		return prepositionalPhrase;
	}



	public void setPrepositionalPhrase(String prepositionalPhrase) {
		this.prepositionalPhrase = prepositionalPhrase;
	}



	public ArrayList<PoStagged> getPrepsPhrasePoS() {
		return prepsPhrasePoS;
	}



	public void setPrepsPhrasePoS(ArrayList<PoStagged> prepsPhrasePoS) {
		this.prepsPhrasePoS = prepsPhrasePoS;
	}



	public ArrayList<String> getObjectedDescriptors() {
		return objectedDescriptors;
	}



	public void setObjectedDescriptors(ArrayList<String> objectedDescriptors) {
		this.objectedDescriptors = objectedDescriptors;
	}



	public void setTaggedPoS( ArrayList<PoStagged> PoSitems){
		   
		taggedPoS = PoSitems;
	}
	
	
	@Override
	public ArrayList<PoStagged> getTaggedSentence() {
		return taggedSentence;
	}


	public void setTaggedSentence(ArrayList<PoStagged> taggedSentence) {
		this.taggedSentence = taggedSentence;
	}


	@Override
	public String getAllPoSasStr() {
		return allPoSasStr;
	}



	public void setAllPoSasStr(String allPoSasStr) {
		this.allPoSasStr = allPoSasStr;
	}



	public void setallPoSasStr( String str ){
		allPoSasStr = str ;
	}

	public String getallPoSasStr( ){
		return allPoSasStr ;
	}
	
	public String getAllSemCodesAsStr(){
		
		return allSemCodesAsStr;
	}



	public void setAllSemCodesAsStr(String allSemCodesAsStr) {
		this.allSemCodesAsStr = allSemCodesAsStr;
	}

	@Override
	public String getGuid() {
		return guid;
	}

	@Override
	public void setGuid(String guid) {
		this.guid = guid;
	}


	@Override
	public boolean isLastResultSet() {
		return isLastResultSet;
	}


	public void setLastResultSet(boolean isLastResultSet) {
		this.isLastResultSet = isLastResultSet;
	}


	public boolean isMergedResults() {
		return mergedResults;
	}

	@Override
	public void setMergedResults(boolean mergedResults) {
		this.mergedResults = mergedResults;
	}


	@Override
	public ArrayList<Integer> getMergedDimension() {
		return mergedDimension;
	}

	@Override
	public void setMergedDimension(ArrayList<Integer> mergedDimension) {
		this.mergedDimension = mergedDimension;
	}


	@Override
	public WordSets getWordSets() {
		return wordSets;
	}

	@Override
	public void setWordSets(WordSets wordSets) {
		this.wordSets = wordSets;
	}



	public boolean isSimple() {
		return isSimple;
	}



	public void setSimple(boolean isSimple) {
		this.isSimple = isSimple;
	}


	
	
	
}
